# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

package(
    default_visibility = ["//visibility:public"],
    licenses = ["notice"],
)

cc_library(
    name = "random_blackbox_events_tests",
    testonly = True,
    srcs = ["random_blackbox_events_tests.cc"],
    hdrs = ["random_blackbox_events_tests.h"],
    data = ["gnmi_subscription_request.textproto"],
    deps = [
        "//gutil/gutil:status_matchers",
        "//gutil/gutil:testing",
        "//lib/basic_traffic",
        "//lib/gnmi:gnmi_helper",
        "//lib/p4rt:p4rt_port",
        "//lib/utils:generic_testbed_utils",
        "//lib/validator:validator_lib",
        "//p4_fuzzer:annotation_util",
        "//p4_fuzzer:fuzzer_cc_proto",
        "//p4_fuzzer:fuzzer_config",
        "//p4_fuzzer:mutation_and_fuzz_util",
        "//p4_fuzzer:switch_state",
        "//p4_pdpi:ir",
        "//p4_pdpi:ir_cc_proto",
        "//p4_pdpi:p4_runtime_session",
        "//p4_pdpi/packetlib:packetlib_cc_proto",
        "//sai_p4/fixed:p4_roles",
        "//sai_p4/instantiations/google:instantiations",
        "//sai_p4/instantiations/google:sai_p4info_cc",
        "//tests/lib:switch_test_setup_helpers",
        "//thinkit:generic_testbed",
        "//thinkit:generic_testbed_fixture",
        "//thinkit:switch",
        "//thinkit:test_environment",
        "//thinkit/proto:generic_testbed_cc_proto",
        "@com_github_gnmi//proto/gnmi:gnmi_cc_grpc_proto",
        "@com_github_gnmi//proto/gnmi:gnmi_cc_proto",
        "@com_github_google_glog//:glog",
        "@com_github_grpc_grpc//:grpc++",
        "@com_github_p4lang_p4runtime//:p4info_cc_proto",
        "@com_github_p4lang_p4runtime//:p4runtime_cc_proto",
        "@com_google_absl//absl/cleanup",
        "@com_google_absl//absl/random",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/time",
        "@com_google_absl//absl/types:span",
        "@com_google_googleapis//google/rpc:code_cc_proto",
        "@com_google_googletest//:gtest",
    ],
    alwayslink = True,
)

cc_library(
    name = "packet_forwarding_tests",
    testonly = True,
    srcs = ["packet_forwarding_tests.cc"],
    hdrs = ["packet_forwarding_tests.h"],
    deps = [
        "//gutil/gutil:collections",
        "//gutil/gutil:status_matchers",
        "//gutil/gutil:testing",
        "//lib/basic_traffic",
        "//lib/basic_traffic:basic_p4rt_util",
        "//lib/gnmi:gnmi_helper",
        "//lib/p4rt:p4rt_programming_context",
        "//lib/utils:generic_testbed_utils",
        "//p4_pdpi:ir",
        "//p4_pdpi:ir_cc_proto",
        "//p4_pdpi:p4_runtime_session",
        "//p4_pdpi/packetlib",
        "//p4_pdpi/packetlib:packetlib_cc_proto",
        "//sai_p4/instantiations/google:sai_pd_cc_proto",
        "//tests/lib:p4info_helper",
        "//tests/lib:switch_test_setup_helpers",
        "//thinkit:control_device",
        "//thinkit:generic_testbed",
        "//thinkit:generic_testbed_fixture",
        "//thinkit:switch",
        "//thinkit/proto:generic_testbed_cc_proto",
        "@com_github_google_glog//:glog",
        "@com_github_p4lang_p4runtime//:p4info_cc_proto",
        "@com_github_p4lang_p4runtime//:p4runtime_cc_proto",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/numeric:int128",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/synchronization",
        "@com_google_absl//absl/time",
        "@com_google_absl//absl/types:span",
        "@com_google_googletest//:gtest",
    ],
    alwayslink = True,
)

cc_library(
    name = "linerate_traffic_test",
    testonly = True,
    srcs = ["linerate_traffic_test.cc"],
    hdrs = ["linerate_traffic_test.h"],
    deps = [
        "//gutil/gutil:collections",
        "//gutil/gutil:proto",
        "//gutil/gutil:status",
        "//gutil/gutil:status_matchers",
        "//gutil/gutil:testing",
        "//lib/gnmi:gnmi_helper",
        "//lib/utils:generic_testbed_utils",
        "//lib/utils:json_utils",
        "//lib/validator:validator_lib",
        "//p4_pdpi:ir",
        "//p4_pdpi:ir_cc_proto",
        "//p4_pdpi:p4_runtime_session",
        "//p4_pdpi:pd",
        "//p4_pdpi/internal:ordered_map",
        "//p4_pdpi/netaddr:ipv4_address",
        "//p4_pdpi/netaddr:ipv6_address",
        "//p4_pdpi/netaddr:mac_address",
        "//p4_pdpi/packetlib",
        "//p4_pdpi/packetlib:packetlib_cc_proto",
        "//sai_p4/instantiations/google:sai_pd_cc_proto",
        "//tests/forwarding:util",
        "//tests/lib:switch_test_setup_helpers",
        "//tests/qos:packet_in_receiver",
        "//tests/qos:qos_test_util",
        "//thinkit:generic_testbed",
        "//thinkit:generic_testbed_fixture",
        "//thinkit/proto:generic_testbed_cc_proto",
        "@com_github_gnmi//proto/gnmi:gnmi_cc_grpc_proto",
        "@com_github_google_glog//:glog",
        "@com_github_grpc_grpc//:grpc++",
        "@com_github_otg_models//:otg_cc_proto",
        "@com_github_otg_models//:otg_grpc_proto",
        "@com_github_p4lang_p4runtime//:p4info_cc_proto",
        "@com_github_p4lang_p4runtime//:p4runtime_cc_proto",
        "@com_google_absl//absl/cleanup",
        "@com_google_absl//absl/container:btree",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_absl//absl/time",
        "@com_google_googletest//:gtest_main",
    ],
    alwayslink = True,
)

cc_library(
    name = "control_device_reboot_test",
    testonly = True,
    srcs = ["control_device_reboot_test.cc"],
    hdrs = ["control_device_reboot_test.h"],
    deps = [
        "//gutil/gutil:status_matchers",
        "//gutil/gutil:testing",
        "//thinkit:control_device",
        "//thinkit:generic_testbed",
        "//thinkit:generic_testbed_fixture",
        "//thinkit/proto:generic_testbed_cc_proto",
        "@com_github_google_glog//:glog",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/time",
        "@com_google_googletest//:gtest_main",
    ],
    alwayslink = True,
)

cc_library(
    name = "alpm_miss_counter_tests",
    testonly = 1,
    srcs = [
        "alpm_miss_counter_tests.cc",
    ],
    hdrs = [
        "alpm_miss_counter_tests.h",
    ],
    deps = [
        "//gutil/gutil:collections",
        "//gutil/gutil:proto",
        "//gutil/gutil:status_matchers",
        "//gutil/gutil:testing",
        "//lib/gnmi:gnmi_helper",
        "//lib/validator:validator_lib",
        "//p4_pdpi:p4_runtime_session",
        "//p4_pdpi:p4_runtime_session_extras",
        "//p4_pdpi/netaddr:mac_address",
        "//p4_pdpi/packetlib",
        "//p4_pdpi/packetlib:packetlib_cc_proto",
        "//sai_p4/instantiations/google:sai_pd_cc_proto",
        "//tests/lib:switch_test_setup_helpers",
        "//thinkit:control_device",
        "//thinkit:generic_testbed",
        "//thinkit:generic_testbed_fixture",
        "//thinkit:switch",
        "@com_github_gnmi//proto/gnmi:gnmi_cc_grpc_proto",
        "@com_github_google_glog//:glog",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/random",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/time",
        "@com_google_absl//absl/types:span",
        "@com_google_googletest//:gtest",
    ],
    alwayslink = 1,
)

